package com.atguigu.fruit.dao.impl;

import com.atguigu.fruit.dao.FruitDAO;
import com.atguigu.myssm.basedao.BasicDao;
import com.atguigu.fruit.pojo.Menu;

import java.util.List;

public class FruitDAOImpl extends BasicDao<Menu> implements FruitDAO {
    @Override
    public List<Menu> getMenu() {
        return super.queryMulti("select * from menu",Menu.class);
    }

    @Override
    public Menu getMenuById(Integer id) {
        return super.querySingle("select * from menu where id=?",Menu.class,id);
    }

    @Override
    public void updateFruit(Menu menu) {
        String sql="update menu set name = ?,price=?,type=? where id=?";
        super.update(sql,menu.getName(),menu.getPrice(),menu.getType(),menu.getId());
    }


}
